package com.ltkj.system.api.factory;

import com.ltkj.common.core.web.domain.AjaxResult;
import com.ltkj.system.api.RemoteTicketService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 订单
 * 
 * @author ruoyi
 */
@Component
public class RemoteTicketFallbackFactory implements FallbackFactory<RemoteTicketService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteTicketFallbackFactory.class);

    @Override
    public RemoteTicketService create(Throwable throwable)
    {
        log.error("票务服务调用失败:{}", throwable.getMessage());
        return new RemoteTicketService()
        {
            @Override
            public AjaxResult paySucessStatus(Long orderId) {
                return AjaxResult.error(("修改订单信息失败" + throwable.getMessage()));
            }
        };
    }
}
